package ch.jamme.conf.def;

import ch.jamme.conf.*;

/**
 * This is the strategy that forces the marshall process to work with a single thread
 * @author Mario Fusco
 */
public class SingleMarshallerThreadStrategy implements MarshallerThreadStrategy {

	/**
	 * Returns the number of parallel thread that should be used to marshall the given object.
	 * This implementation forces the marshall process to work with a single thread.
	 * @param toBeMarshalled The object that is going to be marshalled
	 * @return The number or threads to use. 
	 */
	public int getMarshallerThreadsNumber(Object toBeMarshalled) {
		return 1;
	}

	/**
	 * Returns the number of parallel thread that should be used to unmarshall the given xml.
	 * This implementation forces the marshall process to work with a single thread.
	 * @param xml The xml string that is going to be unmarshalled
	 * @return The number or threads to use.
	 */
	public int getUnmarshallerThreadsNumber(String xml) {
		return 1;
	}
}
